Repository navigation
fix: Unexpected error occurs when a category/Tag approver submits an expense - #79538
Conversation
|
@ShridharGoel Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e4fcfef5e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-14.at.6.58.21.PM.movAndroid: mWeb ChromeScreen.Recording.2026-01-14.at.6.55.58.PM.moviOS: HybridAppScreen.Recording.2026-01-14.at.7.00.05.PM.moviOS: mWeb SafariScreen.Recording.2026-01-14.at.6.50.41.PM.movMacOS: Chrome / SafariScreen.Recording.2026-01-14.at.6.53.05.PM.mov |
| return [...categoryApprovers, ...tagApprovers]; | ||
| // Simplify the rule approvers list by removing two consecutive duplicate approvers. | ||
| const allRuleApprovers = [...categoryApprovers, ...tagApprovers]; | ||
| return allRuleApprovers.filter((approver, index) => index === 0 || approver !== allRuleApprovers.at(index - 1)); |
There was a problem hiding this comment.
Why only consecutive need to be checked? Can't the submitter be there at non-consecutive positions in the list?
There was a problem hiding this comment.
@ShridharGoel After checking getApprovalChain logic again, you're right. I updated.
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks great, but we should have a simple unit test for this which will ensure it's not likely to regress in the future.
|
@neil-marcellini I updated. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product spec changed. Looks good.
neil-marcellini
left a comment
There was a problem hiding this comment.
Thanks for adding the test
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.3.6-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.6-4 🚀
|
Explanation of Change
fix: Unexpected error occurs when a category/Tag approver submits an expense
Fixed Issues
$ #78928
PROPOSAL: #78928 (comment)
Tests
Precondition -
Offline tests
Same
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-01-14.at.15.59.47.mov
Android: mWeb Chrome
Screen.Recording.2026-01-14.at.16.01.07.mov
iOS: Native
Screen.Recording.2026-01-14.at.16.02.11.mov
iOS: mWeb Safari
Screen.Recording.2026-01-14.at.16.03.24.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-14.at.15.58.09.mov